home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Business Shareware
/
Business Shareware.iso
/
start
/
gfxapps
/
pbmpl91d
/
pbmplus
/
src
/
crt0new.s
next >
Wrap
Text File
|
1993-01-08
|
1KB
|
71 lines
/*
** This is a modified version of the startup code. All it does is
** call the function FIX_IO() just before calling main.
** to compile: gcc -o crt0new.s
** to use, make a back up copy of the supplied crt0.o with
** copy crt0.o crt0old.o
** then when building an application that you want to use binary io going
** through stdin/stdout, do: copy crt0new.o crt0.o
** Be sure that when you want to build normal io apps again, you do:
** copy crt0old.o crt0.o
*/
/*
** Called as start(argc, argv, envp)
*/
.text
.globl start
start:
movl %esi,___pid
movl %edi,___transfer_buffer
movl %ebx,_ScreenPrimary
movl %ebp,_ScreenSecondary
xorl %esi,%esi
xorl %edi,%edi
xorl %ebp,%ebp
xorl %ebx,%ebx
movl %esp,%ebx
movl 8(%ebx),%eax
pushl %eax
movl %eax,_environ
pushl 4(%ebx)
pushl (%ebx)
call ___main
call _FIX_IO
call _main
addl $12,%esp
pushl %eax
call _exit
exit_again:
movl $0x4c00,%eax
int $0x21
jmp exit_again
ret
.data
.globl _environ
_environ:
.long 0
.globl ___pid
___pid:
.long 0
.globl ___transfer_buffer
___transfer_buffer:
.long 0
.globl _ScreenPrimary
_ScreenPrimary:
.long 0
.globl _ScreenSecondary
_ScreenSecondary:
.long 0